package cn.learn.fegin;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author huangyezhan
 * @version 1.0
 * @date 2021年04月27日16:12
 */
@RestController
public class FeignController {
    private static Integer num = 1;

    @Resource
    private RemoteService remoteService;

    @PostMapping(value = "/remoteService")
    RestResponse<String> doublyCreateWorkflow(@RequestBody DoublyStochastic doublyStochastic) {
        num++;
        if (num % 2 == 1) {
            remoteService.doublyCreateWorkflow(doublyStochastic);
        }
        System.out.println(doublyStochastic);
        return RestResponse.ok(num + "");
    }


}
